#!/usr/bin/python

# Filename: using_file.py

poem = '''\
Programming is fun
When the work is done
if you wanna make your work also fun:
use Python!
'''

poem_file = 'poem.txt'

f = file( poem_file, 'w' ) # open for writing
f.write( poem )
f.close()

f = file( poem_file )
while True:
	line = f.readline()
	if len( line ) == 0: # Zero length indicates EOF
		break
	print line,
f.close()
